home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / SCRIB3.PAK / MAINFRM.CPP < prev    next >
C/C++ Source or Header  |  1997-05-06  |  3KB  |  118 lines

  1. // MainFrm.cpp : implementation of the CMainFrame class
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992-1995 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13. #include "stdafx.h"
  14. #include "Scribble.h"
  15.  
  16. #include "MainFrm.h"
  17.  
  18. #ifdef _DEBUG
  19. #define new DEBUG_NEW
  20. #undef THIS_FILE
  21. static char THIS_FILE[] = __FILE__;
  22. #endif
  23.  
  24. /////////////////////////////////////////////////////////////////////////////
  25. // CMainFrame
  26.  
  27. IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWnd)
  28.  
  29. BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
  30.     //{{AFX_MSG_MAP(CMainFrame)
  31.         // NOTE - the ClassWizard will add and remove mapping macros here.
  32.         //    DO NOT EDIT what you see in these blocks of generated code !
  33.     ON_WM_CREATE()
  34.     //}}AFX_MSG_MAP
  35. END_MESSAGE_MAP()
  36.  
  37. static UINT indicators[] =
  38. {
  39.     ID_SEPARATOR,           // status line indicator
  40.     ID_INDICATOR_CAPS,
  41.     ID_INDICATOR_NUM,
  42.     ID_INDICATOR_SCRL,
  43. };
  44.  
  45. /////////////////////////////////////////////////////////////////////////////
  46. // CMainFrame construction/destruction
  47.  
  48. CMainFrame::CMainFrame()
  49. {
  50.     // TODO: add member initialization code here
  51.     
  52. }
  53.  
  54. CMainFrame::~CMainFrame()
  55. {
  56. }
  57.  
  58. int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
  59. {
  60.     if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
  61.         return -1;
  62.     
  63.     if (!m_wndToolBar.Create(this) ||
  64.         !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
  65.     {
  66.         TRACE0("Failed to create toolbar\n");
  67.         return -1;      // fail to create
  68.     }
  69.  
  70.     if (!m_wndStatusBar.Create(this) ||
  71.         !m_wndStatusBar.SetIndicators(indicators,
  72.           sizeof(indicators)/sizeof(UINT)))
  73.     {
  74.         TRACE0("Failed to create status bar\n");
  75.         return -1;      // fail to create
  76.     }
  77.  
  78.     // TODO: Remove this if you don't want tool tips
  79.     m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
  80.         CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
  81.     
  82.     // TODO: Delete these three lines if you don't want the toolbar to
  83.     //  be dockable
  84.     m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
  85.     EnableDocking(CBRS_ALIGN_ANY);
  86.     DockControlBar(&m_wndToolBar);
  87.  
  88.  
  89.     return 0;
  90. }
  91.  
  92. BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
  93. {
  94.     // TODO: Modify the Window class or styles here by modifying
  95.     //  the CREATESTRUCT cs
  96.  
  97.     return CMDIFrameWnd::PreCreateWindow(cs);
  98. }
  99.  
  100. /////////////////////////////////////////////////////////////////////////////
  101. // CMainFrame diagnostics
  102.  
  103. #ifdef _DEBUG
  104. void CMainFrame::AssertValid() const
  105. {
  106.     CMDIFrameWnd::AssertValid();
  107. }
  108.  
  109. void CMainFrame::Dump(CDumpContext& dc) const
  110. {
  111.     CMDIFrameWnd::Dump(dc);
  112. }
  113.  
  114. #endif //_DEBUG
  115.  
  116. /////////////////////////////////////////////////////////////////////////////
  117. // CMainFrame message handlers
  118.